<template>
  <div class="right-main">
    <div class="tob-bar">
      <el-breadcrumb separator=">">
        <el-breadcrumb-item :to="{ path: '/' }">收款单据</el-breadcrumb-item>
        <el-breadcrumb-item>详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="mainContainer viewCasePage">
      <!-- 社保表单 -->
      <div class="customform shebaoform" v-if="product.resource === 1">
        <el-form
          :inline="true"
          label-width="120px"
          label-position="left"
        >
          <div class="el-form--inline">
            <el-form-item label="客户名称">
              <div class="el-input  form-control-static">{{product.name}}</div>
            </el-form-item>
            <el-form-item label="收款编号">
              <div class="el-input form-control-static">{{product.orderId}}</div>
            </el-form-item>
            <el-form-item label="订单业务">
              <div class="el-input form-control-static">社保/公积金/商保</div>
            </el-form-item>
          </div>
          <div class="el-form--inline">
            <el-form-item label="收款月份" >
              <div class="el-input form-control-static">{{product.timePay}}</div>
            </el-form-item>
            <el-form-item label="收款金额">
              <div class="el-input form-control-static">
                <div class="el-input form-control-static">{{product.money}}</div>
              </div>
            </el-form-item>
            <el-form-item label="订单时间">
              <div class="el-input form-control-static">{{product.time}}</div>
            </el-form-item>
          </div>
          <div class="el-form--inline">
            <el-form-item label="状态">
              <div class="el-input form-control-static" v-if="product.status===1">未支付</div>
              <div class="el-input form-control-static" v-if="product.status===2">已支付</div>
            </el-form-item>
            <el-form-item label="到款时间">
              <div class="el-input form-control-static">{{product.comTime}}</div>
            </el-form-item>
          </div>
        </el-form>
        <div class="zy-form my-table">
          <template>
            <el-table class="my-table" :data="tableData3" style="width: 100%">
              <el-table-column
                align="center"
                type="index"
                :index="indexMethod"
                label="序号"
                width="100"
              ></el-table-column>
              <el-table-column align="center" label="姓名">
                <span>{{tableData3[0].username}}</span>
              </el-table-column>
              <el-table-column align="center" label="身份证"><span>{{tableData3[0].idCard}}</span></el-table-column>
              <el-table-column label="社保" align="center">
                <el-table-column label="月份" align="center">
                  <template slot-scope="scope">{{tableData3[0].Stime}}</template>
                </el-table-column>
                <el-table-column label="代缴金额" align="center">
                  <template slot-scope="scope">{{tableData3[0].Sbase}}</template>
                </el-table-column>
              </el-table-column>
              <el-table-column label="公积金" align="center">
                <el-table-column label="月份" align="center">
                  <template slot-scope="scope">{{tableData3[0].Atime}}</template>
                </el-table-column>
                <el-table-column label="代缴金额" align="center">
                  <template slot-scope="scope">{{tableData3[0].Abase}}</template>
                </el-table-column>
              </el-table-column>
              <el-table-column label="商保" align="center">
                <el-table-column label="月份" align="center">
                  <template slot-scope="scope">{{tableData3[0].Ctime}}</template>
                </el-table-column>
                <el-table-column label="代缴金额" align="center">
                  <template slot-scope="scope">{{tableData3[0].Cbase}}</template>
                </el-table-column>
              </el-table-column>
              <el-table-column align="center" label="残保金">
                <template slot-scope="scope">
                  <span>{{tableData3[0].tax}}</span>
                </template>
              </el-table-column>
              <el-table-column align="center" prop="maleAgeMin" label="代缴合计"><span>{{tableData3[0].totalM}}</span></el-table-column>
              <el-table-column align="center" prop="maleAgeMin" label="服务费"><span>{{tableData3[0].seriverPay}}</span></el-table-column>
            </el-table>
          </template>
        </div>
      </div>
      <!-- 表格资料 -->
      <div class="customform shebaoform" v-if="product.resource === 2">
        <el-form
          :inline="true"
          label-width="120px"
          label-position="left"
        >
          <div class="el-form--inline">
            <el-form-item label="客户名称">
              <div class="el-input  form-control-static">{{product.name}}</div>
            </el-form-item>
            <el-form-item label="收款编号">
              <div class="el-input form-control-static">{{product.orderId}}</div>
            </el-form-item>
            <el-form-item label="订单业务">
              <div class="el-input form-control-static">薪酬/个税</div>
            </el-form-item>
          </div>
          <div class="el-form--inline">
            <el-form-item label="收款月份" >
              <div class="el-input form-control-static">{{product.timePay}}</div>
            </el-form-item>
            <el-form-item label="收款金额">
              <div class="el-input form-control-static">
                <div class="el-input form-control-static">{{product.money}}</div>
              </div>
            </el-form-item>
            <el-form-item label="订单时间">
              <div class="el-input form-control-static">{{product.time}}</div>
            </el-form-item>
          </div>
          <div class="el-form--inline">
            <el-form-item label="状态">
              <div class="el-input form-control-static" v-if="product.status===1">未支付</div>
              <div class="el-input form-control-static" v-if="product.status===2">已支付</div>
            </el-form-item>
            <el-form-item label="到款时间">
              <div class="el-input form-control-static">{{product.comTime}}</div>
            </el-form-item>
          </div>
        </el-form>
        <div class="zy-form my-table">
          <template>
            <el-table class="my-table" :data="tableData3" style="width: 100%">
              <el-table-column
                align="center"
                type="index"
                :index="indexMethod"
                label="序号"
                width="100"
              ></el-table-column>
              <el-table-column align="center" label="姓名">
                <span>{{tableData3[0].username}}</span>
              </el-table-column>
              <el-table-column align="center" label="身份证"><span>{{tableData3[0].idCard}}</span></el-table-column>
              <el-table-column align="center" label="工资月份"><span>{{tableData3[0].getTime}}</span></el-table-column>
              <el-table-column align="center" label="个税"><span>{{tableData3[0].tax}}</span></el-table-column>
              <el-table-column align="center" label="实发工资"><span>{{tableData3[0].getMoney}}</span></el-table-column>
              <el-table-column align="center" label="服务费"><span>{{tableData3[0].seriverPay}}</span></el-table-column>
            </el-table>
          </template>
        </div>
      </div>
      <!-- 社保表单结束 -->
        <div class="page-form-btn">
          <el-button @click="back">取消</el-button>
<!--          <el-button type="primary" @click="edit">编辑</el-button>-->
        </div>
      <!-- 表格资料结束 -->
    </div>
  </div>
</template>

<script>
import Http from "../../libs/http.js";
export default {
  name: "viewCollection",
  data() {
    return {
      // 险种列表
      mechanism: ["单位", "个人"],
      tableData3: [],
      product:{}
    };
  },
  created() {
    console.log(this.Gloab.dataCode)
    this.getDetail();
  },
  methods: {
    getDetail() {
      Http.api.get("/test/v5/"+this.$route.query.id).then(res => {
        this.product = res.data;
       this.tableData3[0] = res.data;
       console.log(this.tableData3[0].time)
      });
    },
    //编辑
    edit() {
      this.$router.push({ path: "/case/edit",query:{id:this.$route.query.id} });
    },
    indexMethod(index) {
      return index + 1;
    },
    back() {
      this.$router.go(-1);
    }
  }
};
</script>
